// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.gameStates;

import zombie.Lua.LuaEventManager;
import zombie.core.Core;
import zombie.ui.UIManager;

public class TermsOfServiceState extends GameState {
    private boolean bExit = false;
    private boolean bCreated = false;

    @Override
    public void enter() {
        LuaEventManager.triggerEvent("OnGameStateEnter", this);
        if (!this.bCreated) {
            this.bExit = true;
        }
    }

    @Override
    public void exit() {
        UIManager.clearArrays();
    }

    @Override
    public GameStateMachine.StateAction update() {
        return this.bExit ? GameStateMachine.StateAction.Continue : GameStateMachine.StateAction.Remain;
    }

    @Override
    public void render() {
        Core.getInstance().StartFrame();
        Core.getInstance().EndFrame();
        if (Core.getInstance().StartFrameUI()) {
            UIManager.render();
        }

        Core.getInstance().EndFrameUI();
    }

    public Object fromLua0(String string) {
        switch (string) {
            case "created":
                this.bCreated = true;
                return null;
            case "exit":
                this.bExit = true;
                return null;
            default:
                throw new IllegalArgumentException("unhandled \"" + string + "\"");
        }
    }
}
